<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>Spring Security Example </title>
</head>
<body>
<div th:if="${param.error}">
    用户名或密码错误
</div>
<div th:if="${param.logout}">
    您已退出登录
</div>
<div th:if="${message}">
    <label th:text="${message}"></label>
</div>
<br/>
<h2>登录/注册</h2>
<form id="form" th:action="@{/login}" method="post">
    <input type="text" name="username" placeholder="用户名" autocomplete="off"/>
    <br/><br/>
    <input type="password" name="password" placeholder="密码" autocomplete="off"/>
    <br/><br/>
    <label id="remember">
        <input type="checkbox" name="remember-me"/>记住我
    </label>
    <br/><br/>
    <input id="login" type="submit" value="登录" />&nbsp;&nbsp;&nbsp; <input id="register" type="button" value="注册" />
</form>
<script src="http://cdn.bootcss.com/jquery/3.1.0/jquery.min.js"></script>
<script>
    $('#register').click(function () {
        $('#form').prop("action", "register");
        $('#form').submit();
    });
</script>
</body>
</html>